package com.zmzncs.lmtc.module.customer.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmzncs.lmtc.module.customer.pojo.card.Card;
import com.zmzncs.lmtc.module.customer.pojo.card.CardDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 客户-会员卡 Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-08-26
 */
@Repository
public interface CardDao extends BaseMapper<Card> {

    /**根据carId和parkId查询客户车辆停车场月租服务*/
    List<CardDTO> getCustomerMonthCardByCarIdAndParkId(@Param("customerId") Long customerId, @Param("carId") Long carId, @Param("parkId") String parkId);

    /**根据carId和parkId查询客户车辆停车场时长服务*/
    List<CardDTO> getCustomerDurationCardByCarIdAndParkId(@Param("customerId") Long customerId, @Param("carId") Long carId, @Param("parkId") String parkId);

    /**获取客户时长卡剩余时长*/
    Integer getDurationCardTimeLeft(Long customerId);

    /**充值余额*/
    Double getRechargeAmount(Long customerId);

    /**获取客户的会员卡*/
    List<CardDTO> getCustomerCardList(@Param("customerId")Long customerId, @Param("cardTypeList")List<Integer> cardTypeList);

    /**查询使用停车场月租服务的用户数量 */
    Long getMWMonthCustCount(@Param("parkId") Long parkId);

}
